package com.zbzbzzz.PostProcessor;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.stereotype.Component;

/**
 * @Author ：zbzbzzz
 * @Date ：Created in 20:57 2021/3/2
 * @Description：_____
 * @Modified By：
 * @Version: X.X
 */
@Component
public class MyBeanProcessor implements BeanPostProcessor {
	@Override
	public Object postProcessBeforeInitialization(Object o, String s) throws BeansException {
		System.out.println("初始化之前做处理");
		//bean初始化之前做处理的方法
		System.out.println("beanName:"+s);

		return o;
	}

	@Override
	public Object postProcessAfterInitialization(Object o, String s) throws BeansException {
		System.out.println("初始化之后做处理");
		System.out.println("beanName:"+s);
		return o;
	}
}
